package com.itheima.d10_api_object;
/*
    Object类 :
        toString方法
        equals方法
 */

class Student{
String name="小明";
int age=18;

    public Student() {
    }

    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
public class Test1 {
    public static void main(String[] args) {
        Student stu1=new Student();
        stu1.age=23;
        stu1.name="张峰";
        System.out.println(stu1.toString());

        Student stu2=new Student("风",18);
        System.out.println(stu2.toString());

    }
}












